const router = require('koa-router')();
const crawlerController = require('../controllers/Crawler');
const loginCheckMW = require('../middlewares/loginCheck');

router.prefix('/crawler'); //加默认前缀

/* /crawler/crawl_slider_data */
router.get('/crawl_slider_data', loginCheckMW,  crawlerController.crawlSliderData);
/* /crawler/crawl_agency_data */
router.get('/crawl_agency_data', loginCheckMW,  crawlerController.crawlAgencyInfo);
/* /crawler/crawl_recom_course */
router.get('/crawl_recom_course', loginCheckMW,  crawlerController.crawlRecomCourse);
/* /crawler/crawl_course_collection */
router.get('/crawl_course_collection', loginCheckMW,  crawlerController.crawlCourseCollection);
/* /crawler/crawl_teacher */
router.get('/crawl_teacher', loginCheckMW,  crawlerController.crawlTeacher);
/* /crawler/crawl_student */
router.get('/crawl_student', loginCheckMW,  crawlerController.crawlStudent);
/* /crawler/crawl_course_tab */
router.get('/crawl_course_tab', loginCheckMW,  crawlerController.crawlCourseTab);
/* /crawler/crawl_total_course */
router.get('/crawl_total_course', loginCheckMW,  crawlerController.crawlTotalCourse);
/* /crawler/crawl_about_us */
router.get('/crawl_about_us',  loginCheckMW, crawlerController.crawlAboutUs);

router.post('/crawl_action', loginCheckMW, crawlerController.crawlAction)



/* /crawler/crawl_all_data */
router.get('/crawl_all_data', (ctx, next) => {
  // crawlerController.crawlSliderData;
  // crawlerController.crawlAgencyInfo;
  // await crawlerController.crawlSliderData;
  // await crawlerController.crawlSliderData;
  // await crawlerController.crawlSliderData;
  // await crawlerController.crawlSliderData;
  // await crawlerController.crawlSliderData;
  // await crawlerController.crawlSliderData;
});

module.exports = router;
